import java.util.ArrayList;
import java.util.List;
import java.sql.Date;

/**
 * This class holds the information of a patient invoice
 * 
 * @author Matthew Edwards 
 * @version 3-5-11
 */

public class PatientInvoice {
    
    private String name, doctor;
    
    private Date date;
    
    private List<Item> items;
    
    /**
     * Creates a new PatientInvoice.
     * 
     * @param name the name of the patient.
     * @param date the date of the appointment.
     * @param doctor the treating doctor.
     */
    public PatientInvoice(String name, Date date, String doctor){
        this.name = name;
        this.date = date;
        this.doctor = doctor;
        items = new ArrayList<Item>();
    }
    
    /**
     * Gets the name
     * 
     * @return the name in the object
     */
    public String getName(){
        return name;
    }
    
    /**
     * Sets the name
     * 
     * @param input Changes the name to the input
     */
    public void setName(String input){
       name = input;
    }
    
    /**
     * Gets the date of the invoice
     * 
     * @return Date of the invoice
     */
    public Date getDate(){
        return date;
    }
    
    /**
     * Changes the date to the input
     * 
     * @param input The date to be changed
     */
    public void setDate(Date input){
        date = input;
    }
    
    /**Gets the current doctor
     * 
     * @return
     *     The doctor
     */
    public String getDoctor(){
        return doctor;
    }
    
    /**Sets the doctor related to the invoice
     * 
     * @param input
     *     The doctor to be set
     */
    public void setDoctor(String input){
        doctor = input;
    }
      
    /**
     * Gets the items that are on the invoice.
     * 
     * @return
     *    the item class related to the invoice
     */
    public List<Item> getItems(){
        return items;
    }
    
    /**
     * Adds an item to the list.
     * 
     * @param item the item to be added.
     */
    public void addItem(Item item){
    	items.add(item);
    }
    
    /**
     * removes the item at index from the invoice.
     * 
     * @param index the index at which to remove the item from the list.
     */
    public void removeItem(int index){
    	items.remove(index);
    }
    
}